function r2_mean = model_r2_mean_1D(b,time,parameters)
% INPUTS:
% b(1): c_2
% b(2): sigma^2/c_2
% OUTPUTS
% 
%
nv = b(1);
sigma2 = b(2)*b(1);

mode = parameters(1);
L_0  = parameters(2);
a    = parameters(3);
freq = parameters(4);
dx   = parameters(5); % Aggregation length, unit site
l = L_0/dx;           % Lattice size, unit site

r2_mean = zeros(size(time));
for i = 1:length(time)
    r2 = 0.0;
    for n = 1:mode
        lambda = -4.0*pi^2*nv*(n^2)/(L_0^2);
        temp1 = exp(2*lambda*time(i));
        r2 = r2+2*sigma2*(temp1-1)/(2*lambda);
		if n==freq && ~isempty(freq)
            w_p = a*sqrt(L_0/2);
			r2=r2+(w_p*(exp(lambda*time(i))-1)/lambda)^2;
		end
    end
    r2_mean(i) = r2/(L_0);
end
end